package com.fozu.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/*
 * 登录配置类
 */

import com.fozu.common.interceptor.LoginInterceptor;

public class LoginConfig extends WebMvcConfigurerAdapter {
	//注入拦截器
	@Bean
	LoginInterceptor monitorInterceptor() {
       return new LoginInterceptor();
    }
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		InterceptorRegistration interceptor = registry.addInterceptor(monitorInterceptor());
		interceptor.addPathPatterns("/**");
		interceptor.excludePathPatterns("/");
		interceptor.excludePathPatterns("/user/login");
		super.addInterceptors(registry);
	}
}
